package com.riddle.model;

import java.util.Date;

public class Article {

	private Long id;
	
	private String name;
	
	private String content;

	private String summary;
	
	private Date createTime;
	
	private Date modifyTime;
	
	private boolean publiz;
	
	private boolean first;
	
	private User author;

	private String authorname;
	
	private Category category;
	
	private String categoryname;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	public boolean isPubliz() {
		return publiz;
	}

	public void setPubliz(boolean publiz) {
		this.publiz = publiz;
	}

	public boolean isFirst() {
		return first;
	}

	public void setFirst(boolean first) {
		this.first = first;
	}

	public User getAuthor() {
		return author;
	}

	public void setAuthor(User author) {
		if(author != null) {
			setAuthorname(author.getName());
		}
		this.author = author;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		if(category != null) {
			setCategoryname(category.getName());
		}
		this.category = category;
	}

	public String getAuthorname() {
		return authorname;
	}

	public void setAuthorname(String authorname) {
		this.authorname = authorname;
	}

	public String getCategoryname() {
		return categoryname;
	}

	public void setCategoryname(String categoryname) {
		this.categoryname = categoryname;
	}
}
